import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/demo',
    name: 'demo',
    component: () => import('@/views/demo.vue'),
  },
  {
    path: '/',
    redirect: '/home/index'
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: 'index',
        name: 'Index',
        component: () => import('../views/index.vue'),
        meta:{
          thumb:['首页']
        }
      },
      {
        path: 'actor-list',
        name: 'actorList',
        component: () => import('@/views/actor/ActorList.vue'),
        meta:{
          thumb:['首页','演员管理','演员列表']
        }
      },
      {
        path: 'actor-add',
        name: 'actorAdd',
        component: () => import('@/views/actor/ActorAdd.vue'),
        meta:{
          thumb:['首页','演员管理','新增演员']
        }
      },
      {
        path: 'director-list',
        name: 'directorList',
        component: () => import('@/views/director/DirectorList'),
        meta:{
          thumb:['首页','导演管理','导演列表']
        }
      },
      {
        path: 'director-add',
        name: 'directorAdd',
        component: () => import('@/views/director/DirectorAdd'),
        meta:{
          thumb:['首页','导演管理','新增导演']
        }
      },
      {
        path: 'movie-list',
        name: 'movieList',
        component: () => import('@/views/movie/MovieList'),
        meta:{
          thumb:['首页','电影管理','电影列表']
        }
      },
      {
        path: 'movie-add',
        name: 'movieAdd',
        component: () => import('@/views/movie/MovieAdd'),
        meta:{
          thumb:['首页','电影管理','新增电影']
        }
      },
      {
        path: 'movie-update/:id',
        name: 'movieUpdate',
        component: () => import('@/views/movie/MovieUpdate.vue'),
        meta:{
          thumb:['首页','电影管理','修改电影']
        }
      },
      {
        path: 'cinema-list',
        name: 'cinemaList',
        component: () => import('@/views/cinema/cinemaList.vue'),
        meta:{
          thumb:['首页','电影院管理','电影院列表']
        }
      },
      {
        path: 'cinema-add',
        name: 'cinemaAdd',
        component: () => import('@/views/cinema/cinemaAdd.vue'),
        meta:{
          thumb:['首页','电影院管理','新增电影院']
        }
      },
      {
        path: 'cinema-room-list/:cinemaId',
        name: 'cinemaRoomList',
        component: () => import('@/views/cinema/cinemaRoomList.vue'),
        meta:{
          thumb:['首页','电影院管理','电影院列表:/home/cinema-list','放映厅列表']
        }
      },
      {
        path: 'showingon-plan-list/:roomId',
        name: 'showingonPlanList',
        component: () => import('@/views/cinema/showingonPlanList.vue'),
        meta:{
          thumb:['首页','电影院管理','电影院列表:/home/cinema-list','放映厅列表','排片计划列表']
        }
      },
      {
        path: 'showingon-plan-add/:roomId',
        name: 'showingonPlanAdd',
        component: () => import('@/views/cinema/showingonPlanAdd.vue'),
        meta:{
          thumb:['首页','电影院管理','电影院列表:/home/cinema-list','放映厅列表','新增排片计划']
        }
      },
    ]
  },

]

const router = new VueRouter({
  routes
})

export default router
